package com.whale.cloud.util.hbase;

import com.whale.cloud.util.hbase.HbaseClient;
import com.whale.cloud.util.hbase.SpringHbaseClient;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * Created by jiaoshiru on 2017/5/27.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class MainApplication {

    @Autowired
    HbaseClient hbaseClient;

    @Autowired
    SpringHbaseClient springHbaseClient;


    @Test
    public Object hbaseGet() throws Exception {
        String table = "whaleV2.VipProfile";
        String key = "{\"CORP_ID\":\"C10219\",\"VIP_ID\":\"362\"}";
        Object value = hbaseClient.getResultColum(table, key);
        System.out.println("原生Hbase-->"+value);
        return value;
    }

    @Test
    public Object springBootHbaseGet() throws Exception {
        String table = "whaleV2.VipProfile";
        String key = "{\"CORP_ID\":\"C10219\",\"VIP_ID\":\"362\"}";
        Object value = springHbaseClient.getResult(table,key);
        System.out.println("Spring-boot-hbase--->"+value);
        return value;
    }
}
